const fs = require('fs')

function isDirectory(path) {
  return new Promise((resolve, reject) => {
    fs.stat(path, (err, info) => {
      if (err) {
        reject(err)
      }
      if (info.isDirectory()) {
        resolve(true)
      } else {
        resolve(false)
      }
    })
  })
}

module.exports = {
  isDirectory
}
